# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=tcptraceroute
pkgver=1.5beta7
pkgrel=4
pkgdesc='A traceroute implementation using TCP packets.'
arch=('x86_64' 'aarch64')
url='http://michael.toren.net/code/tcptraceroute/'
license=('GPL')
depends=('libpcap>=1.0.0' 'libnet')
groups=('blackarch' 'blackarch-networking')
source=("https://github.com/mct/$pkgname/archive/$pkgname-$pkgver.tar.gz")
sha512sums=('ad5588e62a56f1b5fa851b68280a88e66a900777fe4fd67587262245cd9da17b536b7dc972abe540fc124a93ac76abcabbc55bc32f9f8ee872d5df57b08f7222')

build() {
  cd "$pkgname-$pkgname-$pkgver"

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr --sysconfdir=/etc
  else
    ./configure --build=arm --prefix=/usr --sysconfdir=/etc
  fi

  make
}

package() {
  cd "$srcdir/$pkgname-$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/share"

  make DESTDIR="$pkgdir" install

  mv "$pkgdir/usr/man" "$pkgdir/usr/share/"
}

